class SearchEnterpeiseModel {
  String companyTitle;
  String companyBrief;
  String companyLogo;
  String companyArea;
  int id;
  String isChoiceness;
  List<String> image;
  Video video;
  String caseName;
  String areaName;
  List<Discount> discount;
  String companyBusinessScope;
  int descNum;
  int mobileNum;
  int discountNum;
  int advertisingNum;
  int recommend;
  int advertisement;

  SearchEnterpeiseModel(
      {this.companyTitle,
        this.companyBrief,
        this.companyLogo,
        this.companyArea,
        this.id,
        this.isChoiceness,
        this.image,
        this.video,
        this.caseName,
        this.areaName,
        this.discount,
        this.companyBusinessScope,
        this.descNum,
        this.mobileNum,
        this.discountNum,
        this.advertisingNum,
        this.recommend,
        this.advertisement});

  SearchEnterpeiseModel.fromJson(Map<String, dynamic> json) {
    companyTitle = json['company_title'];
    companyBrief = json['company_brief'];
    companyLogo = json['company_logo'];
    companyArea = json['company_area'];
    id = json['id'];
    isChoiceness = json['is_choiceness'];
    image = json['image'].cast<String>();
    video = json['video'] != null ? new Video.fromJson(json['video']) : null;
    caseName = json['case_name'];
    areaName = json['area_name'];
    if (json['discount'] != null) {
      discount = new List<Discount>();
      json['discount'].forEach((v) {
        discount.add(new Discount.fromJson(v));
      });
    }
    companyBusinessScope = json['company_business_scope'];
    descNum = json['desc_num'];
    mobileNum = json['mobile_num'];
    discountNum = json['discount_num'];
    advertisingNum = json['advertising_num'];
    recommend = json['recommend'];
    advertisement = json['advertisement'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['company_title'] = this.companyTitle;
    data['company_brief'] = this.companyBrief;
    data['company_logo'] = this.companyLogo;
    data['company_area'] = this.companyArea;
    data['id'] = this.id;
    data['is_choiceness'] = this.isChoiceness;
    data['image'] = this.image;
    if (this.video != null) {
      data['video'] = this.video.toJson();
    }
    data['case_name'] = this.caseName;
    data['area_name'] = this.areaName;
    if (this.discount != null) {
      data['discount'] = this.discount.map((v) => v.toJson()).toList();
    }
    data['company_business_scope'] = this.companyBusinessScope;
    data['desc_num'] = this.descNum;
    data['mobile_num'] = this.mobileNum;
    data['discount_num'] = this.discountNum;
    data['advertising_num'] = this.advertisingNum;
    data['recommend'] = this.recommend;
    data['advertisement'] = this.advertisement;
    return data;
  }
}

class Video {
  String url;
  String status;
  String videoTitle;
  String videoId;
  String surfaceImg;

  Video(
      {this.url, this.status, this.videoTitle, this.videoId, this.surfaceImg});

  Video.fromJson(Map<String, dynamic> json) {
    url = json['url'];
    status = json['status'];
    videoTitle = json['video_title'];
    videoId = json['video_id'];
    surfaceImg = json['surface_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['url'] = this.url;
    data['status'] = this.status;
    data['video_title'] = this.videoTitle;
    data['video_id'] = this.videoId;
    data['surface_img'] = this.surfaceImg;
    return data;
  }
}

class Discount {
  String discount;
  String discountsImg;

  Discount({this.discount, this.discountsImg});

  Discount.fromJson(Map<String, dynamic> json) {
    discount = json['discount'];
    discountsImg = json['discounts_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['discount'] = this.discount;
    data['discounts_img'] = this.discountsImg;
    return data;
  }
}
